<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>按钮</button>
    <script>
        var btn = document.querySelector("button");
        btn.onclick = () => {
            // 定时器是由window调用，所以定时器的this都指向window
            setTimeout(() => {
                var obj = {
                    name: '卡莎',
                    fn: () => {
                        console.log(this)
                    }
                }
                obj.fn()
            }, 500)
        }
        


    </script>
</body>
</html>